﻿
<%@ Page Language="C#"  MasterPageFile="~/Admin/admin.master" AutoEventWireup="true"  CodeFile="GrnDetails.aspx.cs" Inherits="Admin_GrnDetails" Title="GrnDetails List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Grn Details List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="GrnDetailsDataSource"
				DataKeyNames="GrnDetailId"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_GrnDetails.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<data:HyperLinkField HeaderText="Grn Id" DataNavigateUrlFormatString="GrnEdit.aspx?GrnId={0}" DataNavigateUrlFields="GrnId" DataContainer="GrnIdSource" DataTextField="GrnDate" />
				<data:HyperLinkField HeaderText="Drug Id" DataNavigateUrlFormatString="DrugDispoEdit.aspx?DrugId={0}" DataNavigateUrlFields="DrugId" DataContainer="DrugIdSource" DataTextField="DrugName" />
				<asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="[Quantity]"  />
				<asp:BoundField DataField="UnitPrice" HeaderText="Unit Price" SortExpression="[UnitPrice]"  />
				<asp:BoundField DataField="ExpDate" DataFormatString="{0:dd-MMM-yyyy}" HtmlEncode="False" HeaderText="Exp Date" SortExpression="[ExpDate]"  />
				<asp:BoundField DataField="BatchLot" HeaderText="Batch Lot" SortExpression="[BatchLot]"  />
				<asp:BoundField DataField="Remark" HeaderText="Remark" SortExpression="[Remark]"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No GrnDetails Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnGrnDetails" OnClientClick="javascript:location.href='GrnDetailsEdit.aspx'; return false;" Text="Add New"></asp:Button>
		<data:GrnDetailsDataSource ID="GrnDetailsDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:GrnDetailsProperty Name="DrugDispo"/> 
					<data:GrnDetailsProperty Name="Grn"/> 
				</Types>
			</DeepLoadProperties>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:GrnDetailsDataSource>
	    		
</asp:Content>



